/**
* wechat mp webtoken
*/
import config from 'config';
import _debug from 'debug';

const debug = _debug('app:lib:wx_authorize:');

/**
* save userinfo to session
* redirect
*/
export default function* () {
  debug('_wechat_userinfo: ', this._wechat_userinfo);

  this.session._wechat_userinfo = this._wechat_userinfo;

  debug('session: ', this.session);

  this.redirect(this.query.redirect_uri || '/404');
}
